
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class=".span12 ">
				<div class="widget-block">
					<div class="widget-head hh">
					<h5><?=$search_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?php print site_url("customer-service/add-pica")?>"><i class="icon-plus"></i> Add New</a></li>
              </ul>
            </div>
					</div>
					<div class="widget-content">
						<div class="widget-box">
               <?=$this->form_eksternal->form_open("", 'class=" form-horizontal well" id="formoutlet"')?>
							
								<fieldset>
                  <fieldset style="width: 45%; float: left">
										<div class="control-group">
											<label class="control-label">Outlet</label>
											<div class="controls">
                         <?=$this->form_eksternal->form_autocomplate("outlet", "id_outlet", "outlet", "id_outlet", site_url("outlet/tambahan/auto-outlet"), $this->global_models->get_field("m_outlet", "name", array("id_outlet" => $this->session->userdata("pica_search_outlet"))), $this->session->userdata("pica_search_outlet"))?>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">Kategori Masalah</label>
											<div class="controls">
                        <?=$this->form_eksternal->form_dropdown('id_kategori', $dropdown,$this->session->userdata("pica_search_id_kategori"), "id='id_kategori'")?>
											</div>
										</div>
                  </fieldset>
                  <fieldset style="width: 45%; float: left">
										<div class="control-group">
											<label class="control-label">Tanggal</label>
											<div class="controls">
                       <?php print $this->form_eksternal->form_date("start_date", $this->session->userdata('pica_search_start_date'), "start_date", "style='width:100px;' onchange='date_value()'")?> - <?=$this->form_eksternal->form_date("end_date", $this->session->userdata('pica_search_end_date'), "end_date", "style='width:100px;'");
                       print $this->form_eksternal->form_dropdown('date_berdasar', $berdasar, $this->session->userdata('pica_search_date_berdasar'), "", "style='width:100px;'");
                       ?>
											</div>
										</div>
										
                  <div class="control-group">
											<label class="control-label">Status</label>
											<div class="controls">
                      <?=$this->form_eksternal->form_dropdown('id_fix', $fix,$this->session->userdata('pica_search_id_fix'), "id='id_fix'")?>
											</div>
										</div>
                    
                  <div class="control-group">
											<label class="control-label">Sorting</label>
											<div class="controls">
                      <?php 
                      $sort = array(
                          "A.due_date ASC"          => "Due Date (ASC)",
                          "A.due_date DESC"         => "Due Date (DESC)",
                          "A.tanggal_buat ASC"      => "Report Date (ASC)",
                          "A.tanggal_buat DESC"     => "Report Date (DESC)",
                          "A.tanggal_selesai ASC"   => "Finish Date (ASC)",
                          "A.tanggal_selesai DESC"  => "Finish Date (DESC)",
                          "D.name ASC"              => "Kategori (ASC)",
                          "D.name DESC"             => "Kategori (DESC)",
                      );
                      print $this->form_eksternal->form_dropdown('sort', $sort, $this->session->userdata('pica_sort'), "id='sort'");
                      ?>
											</div>
										</div>
									
									</fieldset>
								</fieldset>
								
								<div class="form-actions">
									 <button type="submit" name="cari" value="s" class="btn btn-info">Search</button>
                    <button type="submit" name="clear" value="c" class="btn">Clear</button> &nbsp; &nbsp;
                    <input type="submit" class="btn btn-primary" name="export" value="Export To xls"> &nbsp; &nbsp;
                    <input type="submit" class="btn btn-primary" name="report" value="Report"> &nbsp; &nbsp;
                    <input type="submit" class="btn btn-primary" name="rekap" value="Rekap"> &nbsp; &nbsp;
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
</div>
                    
<div id="main-content">
  <div class="container-fluid">
<div class="row-fluid">
    <div class="row-fluid">
    <div class="span12">
       <?php 
       
                                    
//       foreach($parent as $key => $prn){
           
         if($data_total[$key][0]->jumlah == ""){
           $jumlah_data = 0;
         }else{
           $jumlah_data = $data_total[$key][0]->jumlah;
         }
                  print <<<EOD
                  <h4>Total Post : {$data_total[0]->jumlah}</h4>
                  
                  
EOD;
               ?>
       <div class="graph-wrap">
            <div id="total_service_title" class="chart-block">
                <table class="responsive table table-bordered" id="inti-pica">
                    <thead>
                      <tr>
                        <th>Name Outlet</th>
                        <th>Information</th>
                        <th width="150">Problem Identification</th>
                        <th width="150">Corrective Action</th>
                        <th>Date</th>
                        <th width="35">Fix</th>
                      </tr>
                    </thead>
                    <tbody id="ajax-body-pica">
                      
                    </tbody>
                </table>
            </div>
        </div>  
        <span id='total_row_pica' style="display: none"><?php  echo $data_total[0]->jumlah; ?></span>
<script> 
    
  function del_row_class(tr){
  $("."+tr).remove();
}
    $(document).ready( function () {
   
    del_row_class('ajax-pica');
    add_row_tambahan('inti-pica','<?php echo site_url("outlet/ajax-pica-all/")?>/'+$('#total_row_pica').text(),'ajax-body-pica');
    
    
  });
  function load_pica(id){
    if(id == undefined){
      id = 0;
    }
    del_row_class('ajax-pica');
    add_row_tambahan('inti-pica','<?php echo site_url("outlet/ajax-pica-all/")?>/'+$('#total_row_pica').text()+'/'+id,'ajax-body-pica');
    return false;
  }

</script>
        
       
    </div>
    </div>
</div>
  </div>
</div>

       
</form>
<script>
  function add_row_tambahan_sementara(table_pica, site_url, body_pica, param){
    add_row_tambahan(table_pica, site_url, body_pica, param);
  }

  function sign_user(id){
    $("#"+id).text("<?=$this->session->userdata('name')?>");
  }
  function check(id){
    $("#"+id).show();
  }
  function check(id){
    $("#"+id).show();
  }

  function date_value(){
     angka =  $("#start_date").val();
     $("#end_date").val(angka);
  }
  
</script>